/*
 * @Author: wwssaabb
 * @Date: 2021-08-10 17:42:23
 * @LastEditTime: 2021-08-11 15:37:07
 * @FilePath: \react-admin-client\src\redux\actions.js
 */

/* 
  用来生成action对象的函数的模块
  包含同步action和异步action
*/
import { 
  SET_HEAD_TITLE,
  SET_USER,
  SET_CATEGORIES,
  RESET_USER
 } from './constant'

//设置头部title
export const setHeadTitle=(headTitle)=>({type:SET_HEAD_TITLE,data:headTitle})

//设置登录用户，同步任务
export const setUser=(user)=>({type:SET_USER,user})

//用户登出
export const resetUser = (user={}) => ({type:RESET_USER,user})

//设置分类列表
export const setCategories = (categories) => ({type:SET_CATEGORIES,categories})


